//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package com.ty.pdm.system.workFlow.listener.common;

import cn.hutool.extra.spring.SpringUtil;
import com.alibaba.fastjson.JSONObject;
import com.hustcad.plm.pdm.doc.vo.DocDetails;
import com.hustcad.plm.pdm.ec.module.dto.ECObjData;
import com.hustcad.plm.pdm.flowbusiness.model.entity.FlowChgFormView;
import com.hustcad.plm.pdm.flowbusiness.model.entity.FlowObject;
import com.hustcad.plm.pdm.flowbusiness.model.entity.WorkFlowObjectPackage;
import com.hustcad.plm.pdm.partbom.service.TyplmPartBomService;
import com.hustcad.plm.pdm.partbom.service.TyplmPartUsageLinkService;
import com.hustcad.plm.pdm.partbom.vo.PartDetailsVO;
import com.hustcad.plm.pdm.user.service.TyplmUserService;
import com.hustcad.plm.pdm.workflow.annotion.CustomListener;
import com.hustcad.plm.pdm.workflow.annotion.CustomListenerField;
import com.hustcad.plm.pdm.workflow.model.entity.WorkFlowContainerView;
import com.hustcad.plm.pdm.workflow.service.TyplmWorkFlowContainerService;
import com.jsyxdl.k3cloud.listener.K3CloudHttpService;
import com.jsyxdl.k3cloud.listener.WorkFlowObjectPackageRoutine;
import com.jsyxdl.k3cloud.utils.PlmPartOptionUtils;
import com.ty.basic.entity.org.UserDO;
import com.ty.basic.exception.message.SystemErrorCodeEnum;
import org.flowable.engine.delegate.DelegateExecution;
import org.flowable.engine.delegate.ExecutionListener;
import org.flowable.engine.delegate.TaskListener;
import org.flowable.engine.impl.el.FixedValue;
import org.flowable.task.service.delegate.DelegateTask;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.math.BigInteger;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;


@CustomListener(
        category = "金蝶k3cloud任务与执行监听器",
        description = "永续ERP通用接口"
)
public class MaterialApplicationListener implements ExecutionListener, TaskListener {
    private static final Logger log = LoggerFactory.getLogger(MaterialApplicationListener.class);
    private static final long serialVersionUID = -9059663559349037414L;

    @CustomListenerField(
            description = "ERP接口编码",
            defaultValue = "",
            required = true
    )
    private FixedValue code;

    @CustomListenerField(
            description = "ERP接口对象",
            defaultValue = "",
            required = true
    )
    private FixedValue erpObject;
    @CustomListenerField(
            description = "物料已存在是否修改",
            defaultValue = "",
            required = true
    )
    private FixedValue check;


    @CustomListenerField(
            description = "是否处理Desing视图",
            defaultValue = "",
            required = true
    )
    private FixedValue desing;
    @CustomListenerField(
            description = "是否成品校验",
            defaultValue = "",
            required = true
    )
    private FixedValue cpCheck;

    public MaterialApplicationListener() {

    }

    @Override
    public void notify(DelegateExecution execution) {
        try {
            log.info("开始执行监听 ==> 物料清单同步ERP监听MaterialApplicationListener");
            String workFlowContainerIdStr = execution.getProcessInstanceBusinessKey();
            BigInteger workFlowContainerId = new BigInteger(workFlowContainerIdStr);
            TyplmWorkFlowContainerService typlmWorkFlowContainerService = SpringUtil.getBean(
                    TyplmWorkFlowContainerService.class);
            PlmPartOptionUtils plmPartOptionUtils = SpringUtil.getBean(PlmPartOptionUtils.class);
            K3CloudHttpService k3CloudHttpService = SpringUtil.getBean(K3CloudHttpService.class);
            TyplmPartBomService typlmPartBomService = SpringUtil.getBean(TyplmPartBomService.class);

            //是否只发布成品的BOM
            boolean isChekcp = false;
            if (this.cpCheck != null && "是".equals(this.cpCheck.getExpressionText())) {
                isChekcp = true;
            }

            if (typlmWorkFlowContainerService != null) {
                WorkFlowContainerView workFlowContainerView = typlmWorkFlowContainerService.getWorkFlowContainerDetailByPrimaryKey(
                        workFlowContainerId);
                //这里是发布流程
                if (workFlowContainerView instanceof WorkFlowObjectPackage) {
                    WorkFlowObjectPackage workFlowObjectPackage = (WorkFlowObjectPackage) workFlowContainerView;
                    if (workFlowObjectPackage.getFlowObjectList() != null && workFlowObjectPackage.getFlowObjectList()
                            .size() != 0) {
                        TyplmUserService typlmUserService = SpringUtil.getBean(TyplmUserService.class);
                        UserDO userDO = typlmUserService.queryUserByKey(workFlowObjectPackage.getCreatorOid());

                        for (int i = 0; i < workFlowObjectPackage.getFlowObjectList().size(); i++) {
                            FlowObject flowObject = workFlowObjectPackage.getFlowObjectList().get(i);
                            String oType = flowObject.getRefObjectOtype();
                            if ("ty.inteplm.part.CTyPart".equals(oType)) {
                                BigInteger coid = flowObject.getRefObjectOid();
                                String coType = flowObject.getRefObjectOtype();
                                //获取零部件对象
                                PartDetailsVO partDetails = plmPartOptionUtils.getPartDetailsVO(coid, coType);
                                // 有BOM的零部件才继续进行下一步动作
                                BigInteger partDetailOid = new BigInteger(partDetails.getOid());
                                List<BigInteger> partDetailOidList = new ArrayList<>();
                                partDetailOidList.add(partDetailOid);
                                Map<BigInteger, Boolean> Map = typlmPartBomService.existChildNode(partDetailOidList);
                                if (!Map.get(partDetailOid)) {
                                    if (!"物料".equals(this.erpObject.getExpressionText())
                                            && !"BOM保存".equals(this.erpObject.getExpressionText()))
                                    {
                                        continue;
                                    }
                                }
                                //设计视图零部件不发BOM
                                if (this.desing != null && "是".equals(this.desing.getExpressionText())) {
                                } else {
                                    if ("Design".equals(partDetails.getPartView())) {
                                        continue;
                                    }
                                }

                                // 如果监听参数设置只发布成品全阶BOM到ERP的，首先校验零部件对象是否是成品，是就发送，不是就跳过
                                // 如果监听参数未设置的，都发布
                                if (isChekcp) {
                                    boolean cp = false;
                                    if ("成品".equals(partDetails.getTypeName())) {
                                        cp = true;
                                    }
                                    String classDisplayName = partDetails.getClassDisplayName();
                                    //分类名称包含"自制件总成"的且物料名称不包含"漆"的是成品；
                                    if (classDisplayName.indexOf("自制件总成") != -1 && partDetails.getName().indexOf(
                                            "漆") == -1) {
                                        cp = true;
                                    }
                                    //非产成品不同步BOM
                                    if (cp == false) {
                                        // 注意：这里原代码是要返回一个JSONObject，但在当前上下文中我们只需要跳过这个对象
                                        // 所以使用continue而不是return
                                        continue;
                                    }
                                }

                                if (k3CloudHttpService != null) {
                                    try {
                                        String check = "";
                                        if (this.check != null) {
                                            check = this.check.getExpressionText();
                                        }
                                        JSONObject obj = k3CloudHttpService.getWorkFlowObjectPackageRoutine()
                                                .erpTaskWorkderRoutine(this.code.getExpressionText(),
                                                                       this.erpObject.getExpressionText(),
                                                                       check,
                                                                       flowObject,
                                                                       userDO);
                                        if (obj != null) {
                                            JSONObject Result = obj.getJSONObject("Result");
                                            if (Result != null) {
                                                JSONObject ResponseStatus = Result.getJSONObject("ResponseStatus");
                                                if (ResponseStatus.getBooleanValue("IsSuccess") == false) {
                                                    throw SystemErrorCodeEnum.WORK_FLOW_CONTENT_ERROR.getException(
                                                            ResponseStatus.get("Errors").toString());
                                                }
                                            } else {
                                                throw SystemErrorCodeEnum.WORK_FLOW_CONTENT_ERROR.getException(
                                                        "返回ERP结构Result为空");
                                            }
                                        } else {
                                            throw SystemErrorCodeEnum.WORK_FLOW_CONTENT_ERROR.getException(
                                                    "ERP返回结构为空");
                                        }
                                    } catch (Exception e) {
                                        e.printStackTrace();
                                        throw SystemErrorCodeEnum.WORK_FLOW_CONTENT_ERROR.getException(e.getMessage());
                                    }
                                } else {
                                    throw SystemErrorCodeEnum.WORK_FLOW_CONTENT_ERROR.getException(
                                            "K3CloudHttpService无法加载");
                                }
                            }
                        }
                    }
                }
                //这里是变更流程
                else if (workFlowContainerView instanceof FlowChgFormView) {
                    FlowChgFormView flowChgFormView = (FlowChgFormView) workFlowContainerView;
                    TyplmUserService typlmUserService = SpringUtil.getBean(TyplmUserService.class);
                    UserDO userDO = typlmUserService.queryUserByKey(flowChgFormView.getCreatorOid());

                    if (flowChgFormView.getChgFormVO().getEcAffectVOS() != null) {
                        List<FlowObject> flowObjectList = new ArrayList<>();
                        for (int i = 0; i < flowChgFormView.getChgFormVO().getEcAffectVOS().size(); i++) {
                            ECObjData ecObjData = flowChgFormView.getChgFormVO().getEcAffectVOS().get(i);
                            BigInteger partOid = ecObjData.getRefObjectOid();
                            String oType = ecObjData.getRefObjectOtype();
                            FlowObject flowObject = new FlowObject();
                            flowObject.setRefObjectOid(partOid);
                            flowObject.setRefObjectOtype(oType);
                            flowObjectList.add(flowObject);
                        }

                        for (int i = 0; i < flowObjectList.size(); i++) {
                            FlowObject flowObject = flowObjectList.get(i);
                            String oType = flowObject.getRefObjectOtype();
                            if ("ty.inteplm.part.CTyPart".equals(oType)) {
                                //获取零部件对象
                                BigInteger coid = flowObject.getRefObjectOid();
                                String coType = flowObject.getRefObjectOtype();
                                PartDetailsVO partDetails = plmPartOptionUtils.getPartDetailsVO(coid, coType);

                                // 有BOM的零部件才继续进行下一步动作
                                BigInteger partDetailOid = new BigInteger(partDetails.getOid());
                                List<BigInteger> partDetailOidList = new ArrayList<>();
                                partDetailOidList.add(partDetailOid);
                                Map<BigInteger, Boolean> Map = typlmPartBomService.existChildNode(partDetailOidList);
                                if (!Map.get(partDetailOid)) {
                                    if (!"物料".equals(this.erpObject.getExpressionText())
                                            && !"BOM保存".equals(this.erpObject.getExpressionText()))
                                    {
                                        continue;
                                    }
                                }
                                //设计视图零部件不发BOM
                                if (this.desing != null && "是".equals(this.desing.getExpressionText())) {
                                } else {
                                    if ("Design".equals(partDetails.getPartView())) {
                                        continue;
                                    }
                                }
                                // 如果监听参数设置只发布成品全阶BOM到ERP的，首先校验零部件对象是否是成品，是就发送，不是就跳过
                                // 如果监听参数未设置的，都发布
                                if (isChekcp) {
                                    boolean cp = false;
                                    if ("成品".equals(partDetails.getTypeName())) {
                                        cp = true;
                                    }
                                    String classDisplayName = partDetails.getClassDisplayName();
                                    //分类名称包含"自制件总成"的且物料名称不包含"漆"的是成品；
                                    if (classDisplayName.indexOf("自制件总成") != -1 && partDetails.getName().indexOf(
                                            "漆") == -1) {
                                        cp = true;
                                    }
                                    //非产成品不同步BOM
                                    if (cp == false) {
                                        // 注意：这里原代码是要返回一个JSONObject，但在当前上下文中我们只需要跳过这个对象
                                        // 所以使用continue而不是return
                                        continue;
                                    }
                                }

                                if (k3CloudHttpService != null) {
                                    try {
                                        String check = "";
                                        if (this.check != null) {
                                            check = this.check.getExpressionText();
                                        }
                                        JSONObject obj = k3CloudHttpService.getWorkFlowObjectPackageRoutine()
                                                .erpTaskWorkderRoutine(this.code.getExpressionText(),
                                                                       this.erpObject.getExpressionText(), check,
                                                                       flowObject,
                                                                       userDO);
                                        if (obj != null) {
                                            JSONObject Result = obj.getJSONObject("Result");
                                            if (Result != null) {
                                                JSONObject ResponseStatus = Result.getJSONObject("ResponseStatus");
                                                if (ResponseStatus.getBooleanValue("IsSuccess") == false) {
                                                    throw SystemErrorCodeEnum.WORK_FLOW_CONTENT_ERROR.getException(
                                                            ResponseStatus.get("Errors").toString());
                                                }
                                            } else {
                                                throw SystemErrorCodeEnum.WORK_FLOW_CONTENT_ERROR.getException(
                                                        "返回ERP结构Result为空");
                                            }
                                        } else {
                                            throw SystemErrorCodeEnum.WORK_FLOW_CONTENT_ERROR.getException(
                                                    "返回结构为空");
                                        }
                                    } catch (Exception e) {
                                        throw SystemErrorCodeEnum.WORK_FLOW_CONTENT_ERROR.getException(e.getMessage());
                                    }
                                } else {
                                    throw SystemErrorCodeEnum.WORK_FLOW_CONTENT_ERROR.getException(
                                            "K3CloudHttpService无法加载");
                                }
                            }
                        }
                    } else {
                        throw SystemErrorCodeEnum.WORK_FLOW_CONTENT_ERROR.getException("WorkFlowContainerView为空");
                    }
                }

            } else {
                throw SystemErrorCodeEnum.WORK_FLOW_CONTENT_ERROR.getException("TyplmWorkFlowContainerService无法加载");
            }

            log.info("正常执行监听结束 <== 物料清单同步ERP监听MaterialApplicationListener");
        } catch (Exception var5) {
            log.error("监听MaterialApplicationListener异常：", var5);
            throw SystemErrorCodeEnum.WORK_FLOW_CONTENT_ERROR.getException(var5.getMessage());
        }
    }

    @Override
    public void notify(DelegateTask delegateTask) {
        try {
            log.info("开始执行监听 ==> 物料申请MaterialApplicationListener");
            BigInteger workFlowContainerId = new BigInteger(delegateTask.getVariable("workFlowContainerId").toString());
            TyplmWorkFlowContainerService typlmWorkFlowContainerService = SpringUtil.getBean(
                    TyplmWorkFlowContainerService.class);
            PlmPartOptionUtils plmPartOptionUtils = SpringUtil.getBean(PlmPartOptionUtils.class);
            K3CloudHttpService k3CloudHttpService = SpringUtil.getBean(K3CloudHttpService.class);
            TyplmPartBomService typlmPartBomService = SpringUtil.getBean(TyplmPartBomService.class);

            //是否只发布成品的BOM
            boolean isChekcp = false;
            if (this.cpCheck != null && "是".equals(this.cpCheck.getExpressionText())) {
                isChekcp = true;
            }

            if (typlmWorkFlowContainerService != null) {
                WorkFlowContainerView workFlowContainerView = typlmWorkFlowContainerService.getWorkFlowContainerDetailByPrimaryKey(
                        workFlowContainerId);
                if (workFlowContainerView instanceof WorkFlowObjectPackage) {
                    WorkFlowObjectPackage workFlowObjectPackage = (WorkFlowObjectPackage) workFlowContainerView;

                    TyplmUserService typlmUserService = SpringUtil.getBean(TyplmUserService.class);
                    UserDO userDO = typlmUserService.queryUserByKey(workFlowObjectPackage.getCreatorOid());

                    if (workFlowObjectPackage.getFlowObjectList() != null && workFlowObjectPackage.getFlowObjectList()
                            .size() > 0) {

                        for (int i = 0; i < workFlowObjectPackage.getFlowObjectList().size(); i++) {
                            FlowObject flowObject = workFlowObjectPackage.getFlowObjectList().get(i);
                            String oType = flowObject.getRefObjectOtype();
                            if ("ty.inteplm.part.CTyPart".equals(oType)) {
                                BigInteger coid = flowObject.getRefObjectOid();
                                String coType = flowObject.getRefObjectOtype();
                                //获取零部件对象
                                PartDetailsVO partDetails = plmPartOptionUtils.getPartDetailsVO(coid, coType);

                                // 有BOM的零部件才继续进行下一步动作
                                BigInteger partDetailOid = new BigInteger(partDetails.getOid());
                                List<BigInteger> partDetailOidList = new ArrayList<>();
                                partDetailOidList.add(partDetailOid);
                                Map<BigInteger, Boolean> Map = typlmPartBomService.existChildNode(partDetailOidList);
                                if (!Map.get(partDetailOid)) {
                                    if (!"物料".equals(this.erpObject.getExpressionText())
                                            && !"BOM保存".equals(this.erpObject.getExpressionText()))
                                    {
                                        continue;
                                    }
                                }
                                //设计视图零部件不发BOM
                                if (this.desing != null && "是".equals(this.desing.getExpressionText())) {
                                } else {
                                    if ("Design".equals(partDetails.getPartView())) {
                                        continue;
                                    }
                                }

                                // 如果监听参数设置只发布成品全阶BOM到ERP的，首先校验零部件对象是否是成品，是就发送，不是就跳过
                                // 如果监听参数未设置的，都发布
                                if (isChekcp) {
                                    boolean cp = false;
                                    if ("成品".equals(partDetails.getTypeName())) {
                                        cp = true;
                                    }
                                    String classDisplayName = partDetails.getClassDisplayName();
                                    //分类名称包含"自制件总成"的且物料名称不包含"漆"的是成品；
                                    if (classDisplayName.indexOf("自制件总成") != -1 && partDetails.getName().indexOf(
                                            "漆") == -1) {
                                        cp = true;
                                    }
                                    //非产成品不同步BOM
                                    if (cp == false) {
                                        // 注意：这里原代码是要返回一个JSONObject，但在当前上下文中我们只需要跳过这个对象
                                        // 所以使用continue而不是return
                                        continue;
                                    }
                                }
                            }

                            if (k3CloudHttpService != null) {
                                try {
                                    String check = "";
                                    if (this.check != null) {
                                        check = this.check.getExpressionText();
                                    }
                                    JSONObject obj = k3CloudHttpService.getWorkFlowObjectPackageRoutine()
                                            .erpTaskWorkderRoutine(this.code.getExpressionText(),
                                                                   this.erpObject.getExpressionText(), check,
                                                                   flowObject,
                                                                   userDO);
                                    if (obj != null) {
                                        JSONObject Result = obj.getJSONObject("Result");
                                        if (Result != null) {
                                            JSONObject ResponseStatus = Result.getJSONObject("ResponseStatus");
                                            if (ResponseStatus.getBooleanValue("IsSuccess") == false) {
                                                throw SystemErrorCodeEnum.WORK_FLOW_CONTENT_ERROR.getException(
                                                        ResponseStatus.get("Errors").toString());
                                            }
                                        } else {
                                            throw SystemErrorCodeEnum.WORK_FLOW_CONTENT_ERROR.getException(
                                                    "返回ERP结构Result为空");
                                        }
                                    } else {
                                        throw SystemErrorCodeEnum.WORK_FLOW_CONTENT_ERROR.getException(
                                                "返回结构为空");
                                    }
                                } catch (Exception e) {
                                    throw SystemErrorCodeEnum.WORK_FLOW_CONTENT_ERROR.getException(e.getMessage());
                                }
                            } else {
                                throw SystemErrorCodeEnum.WORK_FLOW_CONTENT_ERROR.getException(
                                        "K3CloudHttpService无法加载");
                            }
                        }
                    }
                } else if (workFlowContainerView instanceof FlowChgFormView) {
                    FlowChgFormView flowChgFormView = (FlowChgFormView) workFlowContainerView;
                    TyplmUserService typlmUserService = SpringUtil.getBean(TyplmUserService.class);
                    UserDO userDO = typlmUserService.queryUserByKey(flowChgFormView.getCreatorOid());
                    if (flowChgFormView.getChgFormVO().getEcAffectVOS() != null) {
                        List<FlowObject> flowObjectList = new ArrayList<>();
                        for (int i = 0; i < flowChgFormView.getChgFormVO().getEcAffectVOS().size(); i++) {
                            ECObjData ecObjData = flowChgFormView.getChgFormVO().getEcAffectVOS().get(i);
                            BigInteger partOid = ecObjData.getRefObjectOid();
                            String oType = ecObjData.getRefObjectOtype();
                            FlowObject flowObject = new FlowObject();
                            flowObject.setRefObjectOid(partOid);
                            flowObject.setRefObjectOtype(oType);
                            flowObjectList.add(flowObject);
                        }

                        for (int i = 0; i < flowObjectList.size(); i++) {
                            FlowObject flowObject = flowObjectList.get(i);
                            String oType = flowObject.getRefObjectOtype();
                            if ("ty.inteplm.part.CTyPart".equals(oType)) {
                                BigInteger coid = flowObject.getRefObjectOid();
                                String coType = flowObject.getRefObjectOtype();
                                //获取零部件对象
                                PartDetailsVO partDetails = plmPartOptionUtils.getPartDetailsVO(coid, coType);
                                // 有BOM的零部件才继续进行下一步动作
                                BigInteger partDetailOid = new BigInteger(partDetails.getOid());
                                List<BigInteger> partDetailOidList = new ArrayList<>();
                                partDetailOidList.add(partDetailOid);
                                Map<BigInteger, Boolean> Map = typlmPartBomService.existChildNode(partDetailOidList);
                                if (!Map.get(partDetailOid)) {
                                    if (!"物料".equals(this.erpObject.getExpressionText())
                                            && !"BOM保存".equals(this.erpObject.getExpressionText()))
                                    {
                                        continue;
                                    }
                                }
                                //设计视图零部件不发BOM
                                if (this.desing != null && "是".equals(this.desing.getExpressionText())) {
                                } else {
                                    if ("Design".equals(partDetails.getPartView())) {
                                        continue;
                                    }
                                }

                                // 如果监听参数设置只发布成品全阶BOM到ERP的，首先校验零部件对象是否是成品，是就发送，不是就跳过
                                // 如果监听参数未设置的，都发布
                                if (isChekcp) {
                                    boolean cp = false;
                                    if ("成品".equals(partDetails.getTypeName())) {
                                        cp = true;
                                    }
                                    String classDisplayName = partDetails.getClassDisplayName();
                                    //分类名称包含"自制件总成"的且物料名称不包含"漆"的是成品；
                                    if (classDisplayName.indexOf("自制件总成") != -1 && partDetails.getName().indexOf(
                                            "漆") == -1) {
                                        cp = true;
                                    }
                                    //非产成品不同步BOM
                                    if (cp == false) {
                                        // 注意：这里原代码是要返回一个JSONObject，但在当前上下文中我们只需要跳过这个对象
                                        // 所以使用continue而不是return
                                        continue;
                                    }
                                }

                                if (k3CloudHttpService != null) {
                                    try {
                                        String check = "";
                                        if (this.check != null) {
                                            check = this.check.getExpressionText();
                                        }
                                        JSONObject obj = k3CloudHttpService.getWorkFlowObjectPackageRoutine()
                                                .erpTaskWorkderRoutine(this.code.getExpressionText(),
                                                                       this.erpObject.getExpressionText(), check,
                                                                       flowObject,
                                                                       userDO);
                                        if (obj != null) {
                                            JSONObject Result = obj.getJSONObject("Result");
                                            if (Result != null) {
                                                JSONObject ResponseStatus = Result.getJSONObject("ResponseStatus");
                                                if (ResponseStatus.getBooleanValue("IsSuccess") == false) {
                                                    throw SystemErrorCodeEnum.WORK_FLOW_CONTENT_ERROR.getException(
                                                            ResponseStatus.get("Errors").toString());
                                                }
                                            } else {
                                                throw SystemErrorCodeEnum.WORK_FLOW_CONTENT_ERROR.getException(
                                                        "返回ERP结构Result为空");
                                            }
                                        } else {
                                            throw SystemErrorCodeEnum.WORK_FLOW_CONTENT_ERROR.getException(
                                                    "返回结构为空");
                                        }
                                    } catch (Exception e) {
                                        throw SystemErrorCodeEnum.WORK_FLOW_CONTENT_ERROR.getException(e.getMessage());
                                    }
                                } else {
                                    throw SystemErrorCodeEnum.WORK_FLOW_CONTENT_ERROR.getException(
                                            "K3CloudHttpService无法加载");
                                }
                            }
                        }
                    } else {
                        throw SystemErrorCodeEnum.WORK_FLOW_CONTENT_ERROR.getException("WorkFlowContainerView为空");
                    }
                } else {
                    throw SystemErrorCodeEnum.WORK_FLOW_CONTENT_ERROR.getException("TyplmWorkFlowContainerService为空");
                }
            }
            log.info("正常执行监听结束 <== 物料申请MaterialApplicationListener");

        } catch (Exception var5) {
            log.error("监听MaterialApplicationListener异常：", var5);
            throw SystemErrorCodeEnum.WORK_FLOW_CONTENT_ERROR.getException(var5.getMessage());
        }
    }
}
